package com.fudan.backend.pojo;

import com.fudan.backend.pojo.statics.CartItemStatus;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class CartItem {
    private String cartItemId;
    private String storeId;
    private String userId;
    private String commodityId;
    private Integer commodityNum;
    private Integer status;
    private Commodity commodity;

    public CartItem(String cartItemId, String storeId, String userId, String commodityId, Integer commodityNum, Integer status) {
        this.cartItemId = cartItemId;
        this.storeId = storeId;
        this.userId = userId;
        this.commodityId = commodityId;
        this.commodityNum = commodityNum;
        this.status = status;
        this.commodity = null;
    }

    public CartItem(String userId, String commodityId, String storeId, Integer commodityNum) {
        this.cartItemId = null;
        this.storeId = storeId;
        this.userId = userId;
        this.commodityId = commodityId;
        this.commodityNum = commodityNum;
        this.status = CartItemStatus.Commodity_ON_SALE;
        this.commodity = null;
    }
}
